Optimal. Leaf size=58 \[ -\frac{2 (b+c) \tan ^{-1}\left (\frac{b-a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{\log (a-b \sin (x))}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.138768, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {4401, 2660, 618, 204, 2668, 31} \[ -\frac{2 (b+c) \tan ^{-1}\left (\frac{b-a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{\log (a-b \sin (x))}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4401
Rule 2660
Rule 618
Rule 204
Rule 2668
Rule 31
Rubi steps
\begin{align*} \int \frac{b+c+\cos (x)}{a-b \sin (x)} \, dx &=\int \left (\frac{\left (1+\frac{b}{c}\right ) c}{a-b \sin (x)}+\frac{\cos (x)}{a-b \sin (x)}\right ) \, dx\\ &=(b+c) \int \frac{1}{a-b \sin (x)} \, dx+\int \frac{\cos (x)}{a-b \sin (x)} \, dx\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,-b \sin (x)\right )}{b}+(2 (b+c)) \operatorname{Subst}\left (\int \frac{1}{a-2 b x+a x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-\frac{\log (a-b \sin (x))}{b}-(4 (b+c)) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,-2 b+2 a \tan \left (\frac{x}{2}\right )\right )\\ &=-\frac{2 (b+c) \tan ^{-1}\left (\frac{b-a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{\log (a-b \sin (x))}{b}\\ \end{align*}
Mathematica [A] time = 0.109787, size = 59, normalized size = 1.02 \[ -\frac{2 (b+c) \tan ^{-1}\left (\frac{b-a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{\log (b \sin (x)-a)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.089, size = 116, normalized size = 2. \begin{align*}{\frac{1}{b}\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }-{\frac{1}{b}\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}a-2\,\tan \left ( x/2 \right ) b+a \right ) }+2\,{\frac{b}{\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( x/2 \right ) -2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) }+2\,{\frac{c}{\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( x/2 \right ) -2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.12698, size = 575, normalized size = 9.91 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}}{\left (b^{2} + b c\right )} \log \left (-\frac{{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) - a^{2} - b^{2} + 2 \,{\left (a \cos \left (x\right ) \sin \left (x\right ) - b \cos \left (x\right )\right )} \sqrt{-a^{2} + b^{2}}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) +{\left (a^{2} - b^{2}\right )} \log \left (-b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) + a^{2} + b^{2}\right )}{2 \,{\left (a^{2} b - b^{3}\right )}}, -\frac{2 \, \sqrt{a^{2} - b^{2}}{\left (b^{2} + b c\right )} \arctan \left (-\frac{a \sin \left (x\right ) - b}{\sqrt{a^{2} - b^{2}} \cos \left (x\right )}\right ) +{\left (a^{2} - b^{2}\right )} \log \left (-b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) + a^{2} + b^{2}\right )}{2 \,{\left (a^{2} b - b^{3}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 65.2471, size = 643, normalized size = 11.09 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.07213, size = 122, normalized size = 2.1 \begin{align*} \frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, x\right ) - b}{\sqrt{a^{2} - b^{2}}}\right )\right )}{\left (b + c\right )}}{\sqrt{a^{2} - b^{2}}} - \frac{\log \left (a \tan \left (\frac{1}{2} \, x\right )^{2} - 2 \, b \tan \left (\frac{1}{2} \, x\right ) + a\right )}{b} + \frac{\log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}{b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]